package test2

object MapTest2 {
  def main(args: Array[String]): Unit = {
    var m=Map[String,String]("Dog"->"小狗","Cat"->"小猫","Pig"->"小猪");
    println(m("Pig"))
    println(m.get("Rabbot"))
    m+=("Rabbit"->"兔子")
    m+=("Snake"->"蛇")
    println(m)
    (m+("shoes"->"皮鞋"))("shoes")
    println(m)
    m-="Dog";
    println(m);
    val v = m.map(x=>{x._2})//List
    println("value="+v);
    println(">>>>>>>>>>>>>>>>>>>>>");
    m.foreach(obj=>println(obj._1+",,,,,"+obj._2))
  }
}
